package com.ost.kautilya.utils.metrics;

import com.ost.kautilya.utils.Metric.DataType;

public class Totals extends Population {

	private static final long serialVersionUID = 1L;
	private double total;

	public Totals(DataType dt) {
		super(dt);
		total = 0;
	}

	@Override
	public void push(long index, Number number) {
		super.push(index, number);
		total += number.doubleValue();
	}

	@Override
	protected double asDouble() {
		return total;
	}

	public double getPopulation() {
		return super.asDouble();
	}
	
	@Override
	public void reset() {
		super.reset();
		total = 0;
	}
}
